ASP.NET Core 2 and Vue.js: Full Stack Web Development with Vue, Vuex, and ASP.NET Core 2.0 by Stuart Ratcliffe

ASP.NET Core 2 and Vue.js: Full Stack Web Development with Vue, Vuex, and ASP.NET Core 2.0 by Stuart Ratcliffe

Author:Stuart Ratcliffe [Ratcliffe, Stuart]
Language: eng
Format: epub
Publisher: Packt Publishing
Published: 2018-07-29T23:00:00+00:00


Then, after the Vue.use(BootstrapVue); line, add the following:

Vue.use(VueToastr, {

defaultPosition: "toast-top-right"

});

This is similar to what we've done before, but this particular installation has an optional second argument where we can override some default settings. In this case, we just specify that the toast dialogs should appear at the top-right of the screen by default.

Finally, in the ClientApp/components/product/Details.vue file, locate the addProductToCart function in the methods object of the script section, and right after committing the mutation, add the following line:

this.$toastr("success", "Product added to cart successfully.");



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.